<?php
/**
{
    "uid": "INT //用户Id@search",
    "nick": "VARCHAR //昵称@search",
    "mobile": "VARCHAR //手机@search; @hide",
    "sessionKey": "VARCHAR //小程序session@noList; ",
    "isPromoter": "TINYINT //是推广员@status; 0::不是::@admin; 1::是::@admin; @search; ",
    "avatar": "VARCHAR //头像@image",
    "freeCourseCount": "INT //免费课程@noList; ",
    "promotionCount": "INT //卡券",
    "gold": "INT //金币",
    "score": "INT //积分",
    "remarkCount": "INT //评论数",
    "focusCount": "INT //关注数",
    "sendLike": "INT //点赞数@noList; ",
    "getLike": "INT //获赞数@noList; ",
    "city": "VARCHAR //城市@noList; ",
    "gender": "TINYINT //性别@status; 1::男; 0::女; 2::未知; @noList; ",
    "openId": "VARCHAR //微信openId@hide; @noload; @noList",
    "unionId": "VARCHAR //微信unionId@hide; @noload; @noList",
    "audit": "TINYINT //个人状态@status; 3::正常::@admin; 5::禁封::@admin; @noload; @search; @noList; ",
    "pwd": "VARCHAR //密码@noload; @noList",
    "email": "VARCHAR //用户email@noList; ",
    "ip": "CHAR //ip@noload; @hide; @noList",
    "browser": "VARCHAR //浏览器@noload; @noList",
    "lng": "DECIMAL //经度@delete; @noList; ",
    "lat": "DECIMAL //纬度@delete; @noList; ",
    "fromUid": "INT //邀请来源@noList; @foreign::tbl_user; ",
    "created": "DATETIME //创建日期@noload; @noList; "
}
 */

class User extends Base
{
    
	private $uid= '';//用户Id@search
	private $nick= NULL;//昵称@search
	private $mobile= NULL;//手机@search;@hide
	private $sessionKey= NULL;//小程序session@noList;
	private $isPromoter= "0";//是推广员@status;0::不是::@admin;1::是::@admin;@search;
	private $avatar= NULL;//头像@image
	private $freeCourseCount= "0";//免费课程@noList;
	private $promotionCount= "0";//卡券
	private $gold= "0";//金币
	private $score= "0";//积分
	private $remarkCount= "0";//评论数
	private $focusCount= "0";//关注数
	private $sendLike= "0";//点赞数@noList;
	private $getLike= "0";//获赞数@noList;
	private $city= '';//城市@noList;
	private $gender= "0";//性别@status;1::男;0::女;2::未知;@noList;
	private $openId= NULL;//微信openId@hide;@noload;@noList
	private $unionId= NULL;//微信unionId@hide;@noload;@noList
	private $audit= "3";//个人状态@status;3::正常::@admin;5::禁封::@admin;@noload;@search;@noList;
	private $pwd= NULL;//密码@noload;@noList
	private $email= NULL;//用户email@noList;
	private $ip= NULL;//ip@noload;@hide;@noList
	private $browser= NULL;//浏览器@noload;@noList
	private $lng= "0.0000000";//经度@delete;@noList;
	private $lat= "0.0000000";//纬度@delete;@noList;
	private $fromUid= "0";//邀请来源@noList;@foreign::tbl_user;
	private $created= 'CURRENT_TIMESTAMP';//创建日期@noload;@noList;

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_user';
    }
    
    public  function key(){
        return 'uid';
    }


    
    public static  function hideField()
    {
        return array (  0 => 'mobile',  1 => 'openId',  2 => 'unionId',  3 => 'ip',);
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return [];
    }
            
    public static  function deleteField()
    {
        return array (  0 => 'lng',  1 => 'lat',);
    }
            
    public function className()
    {
        return 'User';
    }
    
    public  function field()
    {
        return array (  'uid' =>   array (    0 => 'INT',    1 => 11,    2 => '用户Id@search',  ),  'nick' =>   array (    0 => 'VARCHAR',    1 => 50,    2 => '昵称@search',  ),  'mobile' =>   array (    0 => 'VARCHAR',    1 => 15,    2 => '手机@search;@hide',  ),  'sessionKey' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '小程序session@noList;',  ),  'isPromoter' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '是推广员@status;0::不是::@admin;1::是::@admin;@search;',  ),  'avatar' =>   array (    0 => 'VARCHAR',    1 => 512,    2 => '头像@image',  ),  'freeCourseCount' =>   array (    0 => 'INT',    1 => 11,    2 => '免费课程@noList;',  ),  'promotionCount' =>   array (    0 => 'INT',    1 => 11,    2 => '卡券',  ),  'gold' =>   array (    0 => 'INT',    1 => 11,    2 => '金币',  ),  'score' =>   array (    0 => 'INT',    1 => 11,    2 => '积分',  ),  'remarkCount' =>   array (    0 => 'INT',    1 => 11,    2 => '评论数',  ),  'focusCount' =>   array (    0 => 'INT',    1 => 11,    2 => '关注数',  ),  'sendLike' =>   array (    0 => 'INT',    1 => 11,    2 => '点赞数@noList;',  ),  'getLike' =>   array (    0 => 'INT',    1 => 11,    2 => '获赞数@noList;',  ),  'city' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '城市@noList;',  ),  'gender' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '性别@status;1::男;0::女;2::未知;@noList;',  ),  'openId' =>   array (    0 => 'VARCHAR',    1 => 50,    2 => '微信openId@hide;@noload;@noList',  ),  'unionId' =>   array (    0 => 'VARCHAR',    1 => 50,    2 => '微信unionId@hide;@noload;@noList',  ),  'audit' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '个人状态@status;3::正常::@admin;5::禁封::@admin;@noload;@search;@noList;',  ),  'pwd' =>   array (    0 => 'VARCHAR',    1 => 32,    2 => '密码@noload;@noList',  ),  'email' =>   array (    0 => 'VARCHAR',    1 => 100,    2 => '用户email@noList;',  ),  'ip' =>   array (    0 => 'CHAR',    1 => 15,    2 => 'ip@noload;@hide;@noList',  ),  'browser' =>   array (    0 => 'VARCHAR',    1 => 255,    2 => '浏览器@noload;@noList',  ),  'lng' =>   array (    0 => 'DECIMAL',    1 => 10,    2 => '经度@delete;@noList;',  ),  'lat' =>   array (    0 => 'DECIMAL',    1 => 10,    2 => '纬度@delete;@noList;',  ),  'fromUid' =>   array (    0 => 'INT',    1 => 11,    2 => '邀请来源@noList;@foreign::tbl_user;',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建日期@noload;@noList;',  ),);
    }


}